/*
 * Copyright (c) 2021 hpmicro
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 */
#include "board.h"
#include "hpm_gpio_drv.h"
#include "hpm_uart_drv.h"

#define LED_CTRL BOARD_G_GPIO_CTRL
#define LED_PORT BOARD_G_GPIO_INDEX
#define LED_PIN  BOARD_G_GPIO_PIN
#define LED_CHAR 'b'
#define LED_DELAY 1000

int main(void)
{
    //board_init_led_pins(); // CPU0 已经初始化了，这里不用再初始化了
    while (1) {
        gpio_write_pin(LED_CTRL, LED_PORT, LED_PIN, BOARD_LED_OFF_LEVEL); // 使用 GPIO0 外设
        board_delay_ms(LED_DELAY); // 使用 GPTMR7 外设

        uart_send_byte(HPM_UART0, LED_CHAR); // 使用UART0外设
        gpio_write_pin(LED_CTRL, LED_PORT, LED_PIN, BOARD_LED_ON_LEVEL);
        board_delay_ms(LED_DELAY);
    }

    return 0;
}
